<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./vue-2.5.js"></script>
</head>

<body>
    <div id="app">
        <div id="div" v-if="changeShow">这是一段文本</div>
        <button @click="getText">BBBBB</button>

    </div>

    <!-- <script>
    let app = new Vue({
        el:'#app',
        data() {
            return {
                changeShow:false,
            }
        },
        methods: {
            getText:function(){
                this .changeShow= true;
                let div = document.getElementById('div').innerHTML;
                console.log('this :', div);
          
            }
        },
    })
    
    </script> -->
    <script>

        let app = new Vue({
            el: '#app',
            data() {
                return {
                    changeShow: false
                }
            },
            methods: {
                getText: function () {
                    this.changeShow = true
                    // console.log('divInner :', divInner);
                    this.$nextTick(function () {
                        let divInner = document.getElementById('div').innerHTML
                        console.log('divInner :', divInner);
                    })
                }
            },
        })
    </script>
</body>

</html>